name_list = []
for i in range(1, 3):
    name = input('请输入第%d个学生姓名：' % i)
    age = input('请输入第%d个学生年龄：' % i)
    sex = input('请输入第%d个学生性别：' % i)
    name_list.append({'name': name, 'age': age, 'sex': sex})
print(name_list)

for dict_stu in name_list:
    for key, value in dict_stu.items():
        print('%s--%s'%(key, value))
